package com.common.viewlibrary.utils;

import android.content.Context;
import android.util.TypedValue;

/**
 * Created by hanyuejian
 * on 2018/7/13.
 */
public class DensityUtils {

    public static int dp2px(Context context, float dpVal)

    {

        return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,
                dpVal, context.getResources().getDisplayMetrics());

    }

}
